<?php
abstract class JamField{
	
	protected $icon = "";
	protected $type = "";
	protected $idfield = "";
	
    public function __construct(){
        
        $this->init();
    }
    
    public function init(){
        
    }
	
	protected function header(){
		?>
		<div class="well">
			<div class="row-fluid">
				<div class="span1">
					<a href="javascript:void();" class="drag"><i class="icon icon-move"></i></a>
					<span class="type-name"><?php echo $this->type;?></span>
				</div>
				<div class="span10">
					<input placeholder="<?php echo __("Label","jamnews")?>" type="text" class="field-label" />
					<input  placeholder="<?php echo __("Meta key","jamnews")?>" type="text" class="field-metakey" />
					<a onclick="return toggle_advanced_field(this);" href="#" class="btn"><i class="icon-chevron-down"></i></a>
				</div>
				<div class="span1">
					<a onclick="return remove_field(this)" href="#"><i class="icon icon-remove  color-red"></i></a>
				</div>
			</div>
		</div>
		<?php
	}
	
	protected function body(){
		
	}
	
	public function display(){
		?>
		<li <?php echo ($this->idfield!="")?"id='{$this->idfield}'":"";?>  class="draggable fields" data_type="field">
			<a class="link-field" href="javascript:void();">
				<?php echo $this->icon; ?> <?php echo __("Field:","jamnews")?>: <?php echo $this->type;?>
			</a>
			<div class="html-field hide">
				<?php $this->header(); ?>
			</div>
            
            <div class="field-advanced-setting hide">
			     <?php $this->body(); ?>
            </div>
		</li> 
		<?php
	}
}
?>